<?php
namespace app\erp\controller;
use think\Controller;
use app\erp\model\CategoryBranddb;
class CategoryBrand extends Base{
    public $db;
    public $post;
    public function _initialize(){
        parent::_initialize();
        $request = request();
        $param = $request->param();
        $this->post = $param;
        $categoryBranddb = new CategoryBranddb();
        $categoryBranddb->param = $this->post;
        $this->db = $categoryBranddb;
    }
    // 保存数据
    public function saveData(){
        $return = $this->db->ajaxSave();
        if ($return != 'success') {
            $this->layuiReturn($return, 0, $return, - 1);
        } else {
            $this->layuiReturn($return,'','保存成功');
        }
    }
    /**
     *
     * @todo 软删除
     */
    public function ajaxDelete()
    {
        $this->db->param = $this->post;
        $this->db->ajaxDelete();
        $this->layuiReturn('删除成功', 0);
    }
}